package org.esk.dablog.web.servlets;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.io.FileUtils;
import org.esk.dablog.ApplicationConstants;
import org.springframework.web.context.support.WebApplicationContextUtils;
import org.springframework.context.ApplicationContext;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContextListener;
import javax.servlet.ServletContextEvent;
import java.io.IOException;
import java.io.File;
import java.io.FileInputStream;

/**
 * This class initializes application configuration
 * User: jc
 * Date: 24.11.2006
 * Time: 23:39:44
 * $Id:$
 */
public class ConfigurationListener implements ServletContextListener {

    public void contextInitialized(ServletContextEvent event) {
        //To change body of implemented methods use File | Settings | File Templates.
        ApplicationContext context =
                WebApplicationContextUtils.getWebApplicationContext(event.getServletContext());
        ApplicationConstants ac = (ApplicationConstants) context.getBean("applicationConstants");
        ApplicationConstants.setInstance(ac);
    }

    public void contextDestroyed(ServletContextEvent servletContextEvent) {
        //To change body of implemented methods use File | Settings | File Templates.
    }

}
